package org.example.web.controller;

import org.springframework.context.annotation.Description;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

@Controller
@RequestMapping("/test")
public class TestController {
    @RequestMapping("/index")
    @Description("index页面!")
    public ModelAndView list(HttpServletRequest request,
                             HttpServletResponse response) {
        Map<String, Object> resultMap = new HashMap<String, Object>();
        Date nowTime = new Date();
        resultMap.put("systemDateTime", nowTime);
        return new ModelAndView("/test/index", resultMap);
    }
}
